package com.tvein.sanguo.controller.Game.user
{
	//flash
	import com.adobe.crypto.MD5;
	//pureMVC
	import org.puremvc.as3.multicore.interfaces.ICommand;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.utilities.fabrication.patterns.command.SimpleFabricationCommand;
	//custom
	import com.tvein.sanguo.common.CommonConstants;
	import com.tvein.sanguo.model.SFSProxy;
//
	public class UserLogin extends SimpleFabricationCommand implements ICommand
	{
		private var sfsData:SFSProxy;
		
		override public function execute(notification:INotification) : void
		{
			sfsData = facade.retrieveProxy(SFSProxy.NAME) as SFSProxy;
			
			var cmdjso:Object = new Object();
			cmdjso["zone"] = "SanGuo";
			cmdjso["Account"] = notification.getBody()[1][0];
			cmdjso["Password"] = MD5.hash(notification.getBody()[1][1]);
			
			sfsData.send("UserLogin", cmdjso);
			
			sendNotification(CommonConstants.SYSTEM_CONSOLE, ["-gameStatus", [1, "登录游戏中..."]]);
		}
		
		//Custom
	}
}